Lexical Source-Code Transformation
نویسندگان
چکیده
As an alternative to syntactic matching on a program’s abstract syntax tree, we explore the use of lexical matching on a program’s source-code. Lexical techniques have been shown to be effective for the approximation of an abstract syntax tree, thus permitting tools that use regular expressions to effectively specify rewrite targets. In this paper, the features needed to support lexical rewriting are examined. As well, we report on several tools created to explore these features and suggest directions for future research.
منابع مشابه
Design and Implementation of a PHP Compiler Front-end
This technical report describes the design and implementation of a front-end for phc, the open source PHP compiler. This front-end provides an excellent basis for developing tools which process PHP source code, and consists of a well-defined Abstract Syntax Tree (AST) specification for the PHP language, a lexical analyser and parser which construct the AST for a given script, and a visitor and ...
متن کاملProcessing Software Source Text in Automated Design Recovery and Transformation
Software source text is the raw material of program understanding and transformation systems. In order to share the results of source analyses, both between phases of a design recovery process, and between tools and systems in different processes, a source text interchange format is needed. This paper describes a simple technique, ‘source factoring’, by which a common structural decomposition o...
متن کاملComposing Source-to-Source Data-Flow Transformations with Rewriting Strategies and Dependent Dynamic Rewrite Rules
Data-flow transformations used in optimizing compilers are also useful in other programming tools such as code generators, aspect weavers, domainspecific optimizers, and refactoring tools. These applications require source-tosource transformations rather than transformations on a low-level intermediate representation. In this paper we describe the composition of source-to-source data-flow trans...
متن کاملLearning Unified Features from Natural and Programming Languages for Locating Buggy Source Code
Bug reports provide an effective way for end-users to disclose potential bugs hidden in a software system, while automatically locating the potential buggy source code according to a bug report remains a great challenge in software maintenance. Many previous studies treated the source code as natural language by representing both the bug report and source code based on bag-of-words feature repr...
متن کاملImplementing an OCL Compiler for .NET
Model-Driven Architecture standardized by OMG facilitates separating the platform-independent part (PIM) and the platform-specific part (PSM) of a system model. The platform-independent artifacts are mainly UML models created with CASE tools. Due to this separation, PIM specified by the developers can be reused across several implementation platforms of the software. PSM is ideally generated au...
متن کامل